home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / OutOfPhase1.01Source / OutOfPhase Folder / WaveTableObject.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-01  |  5.6 KB  |  153 lines  |  [TEXT/KAHL]

  1. /* WaveTableObject.h */
  2.  
  3. #ifndef Included_WaveTableObject_h
  4. #define Included_WaveTableObject_h
  5.  
  6. /* WaveTableObject module depends on */
  7. /* MiscInfo.h */
  8. /* Audit */
  9. /* Debug */
  10. /* Definitions */
  11. /* Array */
  12. /* WaveTableList */
  13. /* Memory */
  14. /* DataMunging */
  15. /* FixedPoint */
  16. /* WaveTableWindow */
  17. /* SampleConsts */
  18. /* FixedPoint */
  19. /* WaveTableStorage */
  20. /* MainWindowStuff */
  21. /* BufferedFileInput */
  22. /* BufferedFileOutput */
  23. /* BinaryCodedDecimal */
  24.  
  25. #include "SampleConsts.h"
  26. #include "FixedPoint.h"
  27. #include "MainWindowStuff.h"
  28.  
  29. struct WaveTableObjectRec;
  30. typedef struct WaveTableObjectRec WaveTableObjectRec;
  31.  
  32. /* forward declarations */
  33. struct CodeCenterRec;
  34. struct MainWindowRec;
  35. struct WaveTableListRec;
  36. struct ArrayRec;
  37. struct WaveTableStorageRec;
  38. struct BufferedInputRec;
  39. struct BufferedOutputRec;
  40.  
  41. /* create a new wave table object with reasonable defaults. */
  42. WaveTableObjectRec*        NewWaveTableObject(struct CodeCenterRec* CodeCenter,
  43.                                                 struct MainWindowRec* MainWindow,
  44.                                                 struct WaveTableListRec* WaveTableList);
  45.  
  46. /* create a new wave table based on the data being passed in. */
  47. WaveTableObjectRec*        NewWaveTableObjectFromData(struct CodeCenterRec* CodeCenter,
  48.                                                 struct MainWindowRec* MainWindow,
  49.                                                 struct WaveTableListRec* WaveTableList, char* RawData,
  50.                                                 NumBitsType NumBits, long NumTables, long FramesPerTable);
  51.  
  52. /* dispose of a wave table object */
  53. void                                    DisposeWaveTableObject(WaveTableObjectRec* WaveTableObj);
  54.  
  55. /* find out if wave table object has been modified */
  56. MyBoolean                            HasWaveTableObjectBeenModified(WaveTableObjectRec* WaveTableObj);
  57.  
  58. /* get a copy of the wave table's name */
  59. char*                                    WaveTableObjectGetNameCopy(WaveTableObjectRec* WaveTableObj);
  60.  
  61. /* set the wave table's name.  the object becomes the owner of the Name block, */
  62. /* so the caller should not release it. */
  63. void                                    WaveTableObjectNewName(WaveTableObjectRec* WaveTableObj,
  64.                                                 char* Name);
  65.  
  66. /* get a copy of the formula applied to the wave table. */
  67. char*                                    WaveTableObjectGetFormulaCopy(WaveTableObjectRec* WaveTableObj);
  68.  
  69. /* install a new formula into the wave table.  the object becomes the owner of */
  70. /* the formula, so the caller should not dispose it. */
  71. void                                    WaveTableObjectNewFormula(WaveTableObjectRec* WaveTableObj,
  72.                                                 char* Formula);
  73.  
  74. /* find out whether its 8 or 16 bits. */
  75. NumBitsType                        WaveTableObjectGetNumBits(WaveTableObjectRec* WaveTableObj);
  76.  
  77. /* find out how many tables there are in the wave table */
  78. long                                    WaveTableObjectGetNumTables(WaveTableObjectRec* WaveTableObj);
  79.  
  80. /* find out how many entries there are in a single table */
  81. long                                    WaveTableObjectEntriesPerTable(WaveTableObjectRec* WaveTableObj);
  82.  
  83. /* get the raw data for a particular wave table.  this returns the actual data, so */
  84. /* don't dispose it.  if any operations are performed on the wave table, this */
  85. /* pointer may become invalid.  the data is in the following format: */
  86. /*  - 8-bit:  array of signed bytes */
  87. /*  - 16-bit:  array of signed short integers */
  88. char*                                    WaveTableObjectGetRawSlice(WaveTableObjectRec* WaveTableObj,
  89.                                                 long WaveTableIndex);
  90.  
  91. /* put new data into the wave table. the object becomes the owner of all data passed in. */
  92. void                                    WaveTableObjectPutNewData(WaveTableObjectRec* WaveTableObj,
  93.                                                 struct WaveTableStorageRec* NewWaveTable);
  94.  
  95. /* tell the wave table to open it's editor window */
  96. MyBoolean                            WaveTableObjectOpenWindow(WaveTableObjectRec* WaveTableObj);
  97.  
  98. /* this is called by the window when it is closing to notify the object. */
  99. /* the object should not take any action. */
  100. void                                    WaveTableObjectClosingWindowNotify(
  101.                                                 WaveTableObjectRec* WaveTableObj, short NewX, short NewY,
  102.                                                 short NewWidth, short NewHeight);
  103.  
  104. /* obtain a fixedpoint array of data.  NIL is returned if there isn't enough memory. */
  105. largefixedsigned*            WaveTableObjectGetFixed(WaveTableObjectRec* WaveTableObj);
  106.  
  107. /* the document's name has changed, so we need to update the windows */
  108. void                                    WaveTableObjectGlobalNameChange(WaveTableObjectRec* WaveTableObj,
  109.                                                 char* NewFilename);
  110.  
  111. /* get the test attack duration */
  112. double                                WaveTableObjectGetTestAttack(WaveTableObjectRec* WaveTableObj);
  113.  
  114. /* put a new test attack duration */
  115. void                                    SetWaveTableObjectTestAttack(WaveTableObjectRec* WaveTableObj,
  116.                                                 double NewTestAttack);
  117.  
  118. /* get the test decay duration */
  119. double                                WaveTableObjectGetTestDecay(WaveTableObjectRec* WaveTableObj);
  120.  
  121. /* put a new test decay duration */
  122. void                                    SetWaveTableObjectTestDecay(WaveTableObjectRec* WaveTableObj,
  123.                                                 double NewTestDecay);
  124.  
  125. /* get the test sampling rate */
  126. long                                    WaveTableObjectGetTestSamplingRate(WaveTableObjectRec* WaveTableObj);
  127.  
  128. /* put a new test sampling rate */
  129. void                                    SetWaveTableObjectTestSamplingRate(WaveTableObjectRec* WaveTableObj,
  130.                                                 long NewTestSamplingRate);
  131.  
  132. /* get the test pitch */
  133. double                                WaveTableObjectGetTestPitch(WaveTableObjectRec* WaveTableObj);
  134.  
  135. /* put a new test pitch */
  136. void                                    SetWaveTableObjectTestPitch(WaveTableObjectRec* WaveTableObj,
  137.                                                 double NewTestPitch);
  138.  
  139. /* load an object from the file */
  140. FileLoadingErrors            WaveTableObjectNewFromFile(WaveTableObjectRec** ObjectOut,
  141.                                                 struct BufferedInputRec* Input, struct CodeCenterRec* CodeCenter,
  142.                                                 struct MainWindowRec* MainWindow,
  143.                                                 struct WaveTableListRec* WaveTableList);
  144.  
  145. /* write the object out to the file. */
  146. FileLoadingErrors            WaveTableObjectWriteDataOut(WaveTableObjectRec* WaveTableObj,
  147.                                                 struct BufferedOutputRec* Output);
  148.  
  149. /* mark wave table object as saved */
  150. void                                    WaveTableObjectMarkAsSaved(WaveTableObjectRec* WaveTableObj);
  151.  
  152. #endif
  153.